*** NOTE:  This do-file performs the Wilcoxon tests for purchase FRMs in Table 5 ***



log using "C:\Documents and Settings\morgan.rose\My Documents\Foreclosure\Geographic Consistency\Stata\Stata Logs\R&R2\20110202 Wilcoxon either -- purch_frm.log", replace



***********************************************************************
***********************************************************************
*** Wilcoxon tests for equality of survival curves across MSA pairs ***
***********************************************************************
***********************************************************************



*** Category:  "purch_frm" ***



***************************
*** ST-setting the data ***
***************************

use "C:\Documents and Settings\morgan.rose\My Documents\Foreclosure\Geographic Consistency\Stata\Stata Data\All 10 MSAs\all10 both_purch_frm generated_50.dta", clear
generate either_fail = 0
replace either_fail = 1 if outcome_a >= 1 & outcome_a != .
stset currmonth, id(big_loan_num) failure(either_fail==1)



***************************************
*** Wilcoxon tests across MSA pairs ***
***************************************



*** Atlanta vs Baltimore ***
sts test msa_num if (msa_num == 1 | msa_num == 2) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs Chicago ***
sts test msa_num if (msa_num == 1 | msa_num == 3) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs LosAngeles ***
sts test msa_num if (msa_num == 1 | msa_num == 4) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs Miami ***
sts test msa_num if (msa_num == 1 | msa_num == 5) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs Minneapolis ***
sts test msa_num if (msa_num == 1 | msa_num == 6) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs NewYork ***
sts test msa_num if (msa_num == 1 | msa_num == 7) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs Phoenix ***
sts test msa_num if (msa_num == 1 | msa_num == 8) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs Pittsburgh ***
sts test msa_num if (msa_num == 1 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Atlanta vs SanAntonio ***
sts test msa_num if (msa_num == 1 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** Baltimore vs Chicago ***
sts test msa_num if (msa_num == 2 | msa_num == 3) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Baltimore vs LosAngeles ***
sts test msa_num if (msa_num == 2 | msa_num == 4) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Baltimore vs Miami ***
sts test msa_num if (msa_num == 2 | msa_num == 5) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Baltimore vs Minneapolis ***
sts test msa_num if (msa_num == 2 | msa_num == 6) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Baltimore vs NewYork ***
sts test msa_num if (msa_num == 2 | msa_num == 7) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Baltimore vs Phoenix ***
sts test msa_num if (msa_num == 2 | msa_num == 8) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Baltimore vs Pittsburgh ***
sts test msa_num if (msa_num == 2 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Baltimore vs SanAntonio ***
sts test msa_num if (msa_num == 2 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** Chicago vs LosAngeles ***
sts test msa_num if (msa_num == 3 | msa_num == 4) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Chicago vs Miami ***
sts test msa_num if (msa_num == 3 | msa_num == 5) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Chicago vs Minneapolis ***
sts test msa_num if (msa_num == 3 | msa_num == 6) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Chicago vs NewYork ***
sts test msa_num if (msa_num == 3 | msa_num == 7) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Chicago vs Phoenix ***
sts test msa_num if (msa_num == 3 | msa_num == 8) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Chicago vs Pittsburgh ***
sts test msa_num if (msa_num == 3 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Chicago vs SanAntonio ***
sts test msa_num if (msa_num == 3 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** LosAngeles vs Miami ***
sts test msa_num if (msa_num == 4 | msa_num == 5) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** LosAngeles vs Minneapolis ***
sts test msa_num if (msa_num == 4 | msa_num == 6) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** LosAngeles vs NewYork ***
sts test msa_num if (msa_num == 4 | msa_num == 7) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** LosAngeles vs Phoenix ***
sts test msa_num if (msa_num == 4 | msa_num == 8) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** LosAngeles vs Pittsburgh ***
sts test msa_num if (msa_num == 4 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** LosAngeles vs SanAntonio ***
sts test msa_num if (msa_num == 4 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** Miami vs Minneapolis ***
sts test msa_num if (msa_num == 5 | msa_num == 6) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Miami vs NewYork ***
sts test msa_num if (msa_num == 5 | msa_num == 7) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Miami vs Phoenix ***
sts test msa_num if (msa_num == 5 | msa_num == 8) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Miami vs Pittsburgh ***
sts test msa_num if (msa_num == 5 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Miami vs SanAntonio ***
sts test msa_num if (msa_num == 5 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** Minneapolis vs NewYork ***
sts test msa_num if (msa_num == 6 | msa_num == 7) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Minneapolis vs Phoenix ***
sts test msa_num if (msa_num == 6 | msa_num == 8) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Minneapolis vs Pittsburgh ***
sts test msa_num if (msa_num == 6 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Minneapolis vs SanAntonio ***
sts test msa_num if (msa_num == 6 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** NewYork vs Phoenix ***
sts test msa_num if (msa_num == 7 | msa_num == 8) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** NewYork vs Pittsburgh ***
sts test msa_num if (msa_num == 7 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** NewYork vs SanAntonio ***
sts test msa_num if (msa_num == 7 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** Phoenix vs Pittsburgh ***
sts test msa_num if (msa_num == 8 | msa_num == 9) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



*** Phoenix vs SanAntonio ***
sts test msa_num if (msa_num == 8 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon






*** Pittsburgh vs SanAntonio ***
sts test msa_num if (msa_num == 9 | msa_num == 10) & outsample_a != 1 & fico > 0 & cltv != 0 & balance != 0, wilcoxon



log close



clear



